from django.urls import re_path
from rest_framework.routers import DefaultRouter

from .views import user_info, user_admin

urlpatterns = [
    # """用户模块路由"""
    re_path(r'^authorizations/$', user_info.AuthorizationsView.as_view()),  # 登陆
    re_path(r'^user/label/$', user_info.UserLabelView.as_view()),  # 修改标签

    # re_path(r'^users/$', user.UserModelViewSet.as_view()),  # 注册
    re_path(r'^user/$', user_admin.UserDetailView.as_view()),  # 用户中心
    re_path(r'^user/password/$', user_admin.UserPasswordView.as_view()),  # 修改密码
    re_path(r'^users/like/(?P<id>\d+)/', user_admin.UserFansView.as_view()),  # 关注
]

router = DefaultRouter()

# 用户管理
router.register(r'users', user_info.UserModelViewSet, basename='users')
# 用户中心
# router.register(r'user', user_admin.UserAdminView, basename='user')
urlpatterns += router.urls
